﻿function $E(id){ return document.getElementById(id);};
function killErrors() {   return true;   }  ;
window.onerror = killErrors;  
/*JSP分页跳转*/
function page(ii){
	var objpage=document.getElementById("pageno");
	if(objpage.value!=ii){
		objpage.value=ii;	
		objpage.onchange();
	}
};
function ajax_json(url,page,val,obj){
    	if(url.indexOf("?")!=-1)
    		$.getJSON(url+"&json=1&"+page+"="+val,null,obj);
    	else
    		$.getJSON(url+"?json=1&"+page+"="+val,null,obj);
};
function ajax_jsonx(url,obj){
	$.getJSON(url+"&t="+new Date().getTime(),null,obj);
};
function IsChinese(val){
	var uflag=false;
	for(var nIndex=0; nIndex<val.length; nIndex++){
		var cCheck = val.charAt(nIndex);
 		var re=/^[\u4E00-\u9FA5\uF900-\uFA2D]*$/;
 		var x = re.test(cCheck);
 		if(x){
 			uflag=true;
 			break;
 		}
 	}
 	return uflag;
};
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
/*随机数*/
function rnd() {
　　rnd.seed = (rnd.seed*9301+49297) % 233280;
　　return rnd.seed/(233280.0);
};
function getLoginRand(){
	var a = (rnd()*876+"").replace(".","1").substring(0,5);
	return "<span id='yzms'>"+a+"</span>";
};
function getRegRand(){
	var a = (rnd()*876+"").replace(".","1").substring(0,5);
	return "<span id='yzms1'>"+a+"</span>";
};
/*随机数-取在[number]之内的随机数*/
function rands(number) {
	return Math.ceil(rnd()*number);
};
function ajax_post(url,data,obj){
	$.post(url,data,obj,"json");
};
function StringBuffer(){this._strings = new Array;};
StringBuffer.prototype.append = function(str){this._strings.push(str);};
StringBuffer.prototype.toString = function(){return this._strings.join("");};
/*字符长度判断*/
function msg_null(id,msg,size){
	
	var val=$E(id).value.replace(/\ /g,"");

	if(val=="" || val.length>size){
		alert(msg);
		return false;
	}
	return true;
};
function Replacex(stringObj,old,news){
	var reg=new RegExp(old,"g"); //创建正则RegExp对象
	var newstr=stringObj.replace(reg,news); 
	return newstr;
};
function msg_null_div(id,msg,size,div){
	var val=$E(id).value.replace(/\ /g,"");
	$E(div).innerHTML="";
	if(val=="" || val.length>size){
		$E(div).innerHTML=msg;
		return false;
	}
	return true;
};
function dis_null(id){
	var o=$E(id);
	o.disabled=true;
};
/*取消禁用处理*/
function rdis_null(id){
	var o=$E(id);
	o.disabled=false;
};
function get_date(){
  var today = new Date();
  var day ="" ;
  var date ="";
  if(today.getDay()==0)day ="星期日";
  if(today.getDay()==1)day ="星期一";
  if(today.getDay()==2)day ="星期二";
  if(today.getDay()==3)day ="星期三";
  if(today.getDay()==4)day ="星期四";
  if(today.getDay()==5)day ="星期五";
  if(today.getDay()==6)day ="星期六";
  date  = today.getYear()+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日";
  var data_strx="今天是："+date+"&nbsp;"+day;
  return data_strx;
};

function rCookie(name){
	  var cookieValue = "";
	  var search = "student_cookie_"+name + "=";
	  if(document.cookie.length > 0){
		offset = document.cookie.indexOf(search);
		if (offset != -1){
		  offset += search.length;
		  end = document.cookie.indexOf(";", offset);
		  if (end == -1) end = document.cookie.length;
		  cookieValue = (document.cookie.substring(offset, end));
		}
	  }
	  return decodeURIComponent(cookieValue);
};
function wCookie(name, value, hour){
	  name = "student_cookie_"+name;
	  var expire = "";
	  if(hour != null){
		expire = new Date((new Date()).getTime() + hour*3600000);
		expire = "; expires=" + expire.toGMTString();
	  }
	  var p=";path=/";
	  document.cookie = name + "=" + escape(value) +p+ expire;
};

function getCookeyKey_type(){
	return rCookie("type");
};
function getCookeyKey_username(){
	return rCookie("username");
};
var utf = new Object();
utf['一年级']='%E4%B8%80%E5%B9%B4%E7%BA%A7';
utf['二年级']='%E4%BA%8C%E5%B9%B4%E7%BA%A7';
utf['三年级']='%E4%B8%89%E5%B9%B4%E7%BA%A7';
utf['四年级']='%E5%9B%9B%E5%B9%B4%E7%BA%A7';
utf['五年级']='%E4%BA%94%E5%B9%B4%E7%BA%A7';
utf['六年级']='%E5%85%AD%E5%B9%B4%E7%BA%A7';
utf['上学期']='%E4%B8%8A%E5%AD%A6%E6%9C%9F';
utf['下学期']='%E4%B8%8B%E5%AD%A6%E6%9C%9F';
utf['语文']='%E8%AF%AD%E6%96%87';
utf['数学']='%E6%95%B0%E5%AD%A6';
utf['英语']='%E8%8B%B1%E8%AF%AD';
utf['人教版']='%E4%BA%BA%E6%95%99%E7%89%88';
utf['苏教版']='%E8%8B%8F%E6%95%99%E7%89%88';
utf['新课标']='%E6%96%B0%E8%AF%BE%E6%A0%87';
function stat_update(flag){
	var id = rCookie("teacher");
	$E("stat_0").className="";
	$E("stat_1").className="";
	$E("stat_"+flag).className="red";
	ajax_jsonx("/teacher/stat.html?id="+id+"&stat="+flag,stat_update_back);
	
};
function stat_update_back(data){

};

function teacher_info_edit(t){
	var id = rCookie("teacher");
	t.href="/teacher/self_edit.html?id="+id;
};

function stat_service(){
	var id = rCookie("teacher");
	ajax_jsonx("/teacher/service.html?id="+id,stat_service_back);
};
function stat_service_back(data){
	//alert(data.A_1);
	$E("A_1").innerHTML=data.A_1+"";
	$E("A_2").innerHTML=data.A_2+"";
	$E("A_3").innerHTML=data.A_3+"";
	
	$E("B_1").innerHTML=data.B_1+"";
	$E("B_2").innerHTML=data.B_2+"";
	$E("B_3").innerHTML=data.B_3+"";
	
	$E("C_1").innerHTML=data.C_1+"";
	$E("C_2").innerHTML=data.C_2+"";
	$E("C_3").innerHTML=data.C_3+"";
	
	$E("pd_num").innerHTML=data.pd_num+"";
	
	$E("stat_0").className="";
	$E("stat_1").className="";
	$E("stat_"+data.stat).className="red";
};

/*----前台要用的---*/

function show_jc(grade){
	var fix = "";
	for(p in o_type){
		var ox = o_type[p];
		if(ox[1]==grade+"单元上学期"){
			fix+=p+",";
		}
		if(ox[1]==grade+"单元下学期"){
			fix+=p+",";
		}
	}
	show_table(grade,fix);
};
function show_table(grade,fix){	
	var pic = new StringBuffer();
	var txt = new StringBuffer();
	var size=0;
	var fixx = fix.split(",");
	for(var i=0;i<fixx.length-1;i++){
		var o = o_type[fixx[i]];
		var ot = o[2].split(",");
		for(var k=0;k<ot.length;k++){
			size++;
			var otks = ot[k].split(":");
			pic.append("<td align=center><img src='"+otks[2]+"' width='85' height='100'></td>");
			if(o[1].indexOf("上学期")!=-1)
				txt.append("<td><div align='center'><a href='/jc_show.html?version="+utf[o[0]]+"&grade="+utf[grade]+"&subject="+utf[otks[0]]+"&trimester="+utf['上学期']+"'>"+o[0]+"-"+otks[0]+"-上学期</a></div></td>");
			else
				txt.append("<td><div align='center'><a href='/jc_show.html?version="+utf[o[0]]+"&grade="+utf[grade]+"&subject="+utf[otks[0]]+"&trimester="+utf['下学期']+"'>"+o[0]+"-"+otks[0]+"-下学期</a></div></td>");
			if(size>=7)break;
		}
		if(size>=7)break;
	}
	$("."+grade).html("<table width='650' border='0' cellspacing='7' cellpadding='0' class='ui-tabs-panel'><tr>"+pic.toString()+"</tr><tr>"+txt.toString()+"</tr></table>");
};
function show_jc_subject(subject){
	var fix = "";
	for(p in o_type){
		var ox = o_type[p];
		if(ox[1].indexOf("单元")!=-1 && ox[1].indexOf("简介")==-1){
			fix+=p+",";
		}
	}
	//alert(fix);
	show_table_subject(subject,fix);
};
function show_table_subject(subject,fix){
	var pic = new StringBuffer();
	var txt = new StringBuffer();
	var size=0;
	var fixx = fix.split(",");
	for(var i=0;i<fixx.length-1;i++){
		var o = o_type[fixx[i]];
		var ot = o[2].split(",");
		for(var k=0;k<ot.length;k++){
			var otks = ot[k].split(":");
			if(otks[0]==subject){
				pic.append("<td align=center><img src='"+otks[2]+"' width='85' height='100'><br/>");
				if(o[1].indexOf("上学期")!=-1)
					pic.append("<a href='/jc_show.html?version="+utf[o[0]]+"&grade="+utf[o[1].replace("单元上学期","")]+"&subject="+utf[otks[0]]+"&trimester="+utf['上学期']+"'>"+o[1].replace("单元上学期","")+"上-"+o[0]+"</a><br>&nbsp;<br></td>");
				else
					pic.append("<a href='/jc_show.html?version="+utf[o[0]]+"&grade="+utf[o[1].replace("单元下学期","")]+"&subject="+utf[otks[0]]+"&trimester="+utf['下学期']+"'>"+o[1].replace("单元下学期","")+"下-"+o[0]+"</a><br>&nbsp;<br></td>");
				size++;
				if(size%3==0){
					pic.append("<tr>");
				}
			}
		}
	}
	//alert(pic.toString());
	$(".subject_all").html("<table width='650' border='0' cellspacing='7' cellpadding='0' class='ui-tabs-panel'><tr><td><br></td></tr><tr>"+pic.toString()+"</tr></table>");
};
function show_jc_grade(grade){
	var fix = "";
	for(p in o_type){
		var ox = o_type[p];
		if(ox[1].indexOf("单元")!=-1 && ox[1].indexOf("简介")==-1){
			fix+=p+",";
		}
	}
	//alert(fix);
	show_table_grade(grade,fix);
};
function show_table_grade(grade,fix){
	var pic = new StringBuffer();
	var txt = new StringBuffer();
	var size=0;
	var fixx = fix.split(",");
	for(var i=0;i<fixx.length-1;i++){
		var o = o_type[fixx[i]];
		var ot = o[2].split(",");
		for(var k=0;k<ot.length;k++){
			var otks = ot[k].split(":");
			if(o[1].indexOf(grade)!=-1){
				pic.append("<td align=center><img src='"+otks[2]+"' width='85' height='100'><br/>");
				if(o[1].indexOf("上学期")!=-1)
					pic.append("<a href='/jc_show.html?version="+utf[o[0]]+"&grade="+utf[o[1].replace("单元上学期","")]+"&subject="+utf[otks[0]]+"&trimester="+utf['上学期']+"'>"+o[1].replace("单元上学期","")+"上-"+o[0]+"</a><br>&nbsp;<br></td>");
				else
					pic.append("<a href='/jc_show.html?version="+utf[o[0]]+"&grade="+utf[o[1].replace("单元下学期","")]+"&subject="+utf[otks[0]]+"&trimester="+utf['下学期']+"'>"+o[1].replace("单元下学期","")+"下-"+o[0]+"</a><br>&nbsp;<br></td>");
				size++;
				if(size%3==0){
					pic.append("<tr>");
				}
			}
		}
	}
	//alert(pic.toString());
	$(".subject_all").html("<table width='650' border='0' cellspacing='7' cellpadding='0' class='ui-tabs-panel'><tr><td><br></td></tr><tr>"+pic.toString()+"</tr></table>");
};
function show_jc_span(x){
	for(var i=1;i<=7;i++){
		if(i==x){
			$E("fragment-"+i).style.display="";
			$E("top-"+i).className="hover";
		}else{
			$E("fragment-"+i).style.display="none";
			$E("top-"+i).className="";
		}
	}
};
function show_chat_span(x){
	for(var i=1;i<=7;i++){
		if(i==x){
			$E("chat_fragment-"+i).style.display="";
			$E("chat-"+i).className="hover";
		}else{
			$E("chat_fragment-"+i).style.display="none";
			$E("chat-"+i).className="";
		}
	}
};

function show_result(id){
	ajax_jsonx("/info_result.html?id="+id,show_result_back);
};
function show_result_back(data){
	var id = data.id;
	var pic  = data.pic;
	var pic2 = data.pic2;
	var pic3 = data.pic3;
	var info = data.info;if(info=="")info="该题没有解题思路";
	var result = data.result;if(result=="")result="该题没有参考答案";
	var title = $E("T"+id).title;
	if(pic!="")title+="<br/><img src='"+pic+"' />";
	if(pic2!="")info+="<br/><img src='"+pic2+"' />";
	if(pic3!="")result+="<br/><img src='"+pic3+"' />";
	var html="";
	html+="[<b>题目</b>]:"+title;
	html+="<br/><br/>[<b>解题思路</b>]:<br/><br/>"+info;
	html+="<br/><br/><a href='javascript:show_res()'>[<b>参考答案</b>]:</a>&nbsp;&nbsp;<span id='key_txt' style='display:none' class='STYLE14'>请输入家长密码:<input id='key_val' type='password' class='STYLE7' style='width:70px; height:20px'>&nbsp;<a href='javascript:show_res_ok()'>确定</a></span><br/><br/><span id='res_info' style='display:none'>"+result+"</span>";
	dialogx("解题思路","text:"+html,"500px","auto","text");

};

function show_res(){
	var pas1 = rCookie("key");
	var pas = rCookie("Y_key");
	if(pas1==""){
		alert("您还没有登录，不能查看答案!");
	}else{
		if(pas=="")$E("key_txt").style.display="";
		else $E("res_info").style.display="";
	}
};
function show_res_ok(){
	var pas1 = rCookie("key");
	var pas2 = $E("key_val").value;
	if(pas1==pas2 && pas1!=""){//对了，写入cookie,并显示答案
		$E("res_info").style.display="";
		$E("key_txt").style.display="none";
		wCookie("Y_key", pas1, 24);
	}else{
		alert("家长密码错误!");
	}
};
function upload_self_msg(){
	dialogx("请输入您的密码,然后修改个人资料","text:<p align=center>密码：<input type='text' id='old_pas' >&nbsp;<a href='javascript:upload_self_msg_ok()'>确定</a></p>","500px","auto","text");
};
function upload_self_msg_ok(){
	var old = $E("old_pas").value;
	var x= rCookie("pass");
	if(old!=x){
		alert("旧密码不正确!");
	}else{
		window.location.href="/edit_my_info.html";
	}
};


function web_order(roomid,roomname){
	var username = rCookie("username");
	var str="";
	if(username=="")
	{
		str="请登陆后使用，咨询热线0951-5670007<br>";
		str+="帐　号：<input id='username' name='username' type='text' class='STYLE7' style='width:95px; height:20px'><br>";
		str+="密　码：<input id='password' name='password' type='password' class='STYLE7' style='width:95px; height:20px'><br>";
		str+="<a href=javascript:user_load2()><img src=/images/user.gif width=62 height=21 border=0 /></a> <a href=/reg.html><img src=/images/reg.gif width=80 height=21 border=0 /></a>";
		dialogx("提示："+roomname,"text:"+str,"400px","auto","text");
	}
	
	if(username!="")
	{
		str="请订购后使用，咨询热线0951-5670007";	
		var city 	 = rCookie("city");
		str+="<br>您的真实姓名：<input id='Xusername' tyle='text' value='"+username+"'><br>";
		str+="您的联系方式：<input id='Xmobile' tyle='text'><br>";
		str+="您所在的城市：<input id='Xcity' tyle='text' value='"+city+"'><br>";
		str+="<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
		str+="<a href='javascript:web_order_ok("+roomid+")'>提交</a><br>";	
		dialogx("订购提示："+roomname,"text:"+str,"400px","auto","text");
	}
	
};
function web_orders(roomid,roomname){
	var username = rCookie("username");
	if(username=="")web_order(roomid,roomname);
	if(username!=""){
		$E("Rmidx").href="/chats/chat.html?roomID="+roomid;
		$E('Rmidx').click();
	}
	
};
function web_order_ok(id){
	var username = $E("Xusername").value;
	var mobile = $E("Xmobile").value;
	var city = $E("Xcity").value;
	if(username==""){
		alert("请填写您的姓名");
		return;
	}
	if(mobile==""){
		alert("请填写您的联系方式");
		return;
	}
	if(city==""){
		alert("请填写您所在的城市");
		return;
	}
	ajax_post("/weborder.html","?username="+username+"&mobile="+mobile+"&city="+city+"&roomid="+id,null);
	alert("申请成功");
	$("#floatBox .title span").click();
};
function student_0(val){
	for(var a=0; a<1; a++){
		var cCheck = val.charAt(a);
 		if(cCheck=="0")return student_0(val.substring(1,val.length));
 		else return val;
 	}
};
function user_load(){
	var yzms = $E("yzms").innerHTML;
	var yzm  = $E("yzm").value;
	var username = student_0($E("username").value);
	var password = student_0($E("password").value);
	wCookie("Y_username", username, 24*10);
	wCookie("Y_password", password, 24*10);
	if(yzms==yzm){
		ajax_post("/login.html","&username="+username+"&password="+password,user_load_back);
	}else{
		alert("验证码不正确!");
	}
};
function user_load2(){
	
	var username = student_0($E("username").value);
	var password = student_0($E("password").value);
	wCookie("Y_username", username, 24*10);
	wCookie("Y_password", password, 24*10);
	ajax_post("/login.html","&username="+username+"&password="+password,user_load_back);
	
};
function login_init(){
	var username = rCookie("Y_username");
	var password = rCookie("Y_password");
	$E("username").value=username;
	$E("password").value=password;
	wCookie("Y_key", "", 24);
};
function user_load_ok(username,password){
	ajax_post("/login.html","&username="+username+"&password="+password,user_load_back);
};
function user_load_back(data){
	if(data.stat==1){
		if(data.flag==1){
			wCookie("Y_key", "", 24);
			location.href="/myindex.html";
		}else{
			alert("您已经被管理员锁定，如需继续使用请与管理员联系。");
		}
	}else{
		alert("密码错误或用户不存在!");
	}
};

function show_rating(rating){
	var rat = new StringBuffer();
	for(var i=1;i<=rating;i++){
		rat.append("<img src='/images/star_y.gif' width='12' height='11'>");
	}
	return rat.toString();
};


var url = "";
function comm_send(qid,k){
	var studentid = rCookie("student");
	if(studentid=="")studentid="0";
	var studentname = rCookie("username");
	if(studentname=="")studentname="游客";
	var rating = $("input[@type=radio][@checked]").val();
	var msg = $E("comm_txt").value.replace(/\ /g,"");
	if(msg=="" || msg.length>50){
		alert("不能超过50个字");
	}else{
		ajax_post("/push_comm.html","studentid="+studentid+"&studentname="+studentname+"&rating="+rating+"&msg="+msg+"&k="+k+"&qid="+qid,comm_send_back);
		url = window.location.href;
	}
};
function comm_send_back(data){
	window.location.href = url;
};
function setSelectState(state)
{
	var objl=document.getElementsByTagName('select');
	for(var i=0;i<objl.length;i++)
	{
	objl[i].style.visibility=state;
	}
};
var isIe=(document.all)?true:false;
var dialogFirst=true;
function dialogx(title,content,width,height,cssName){
if(isIe){
	setSelectState('hidden');
	}
if(dialogFirst==true){
  var temp_float=new String;
  temp_float="<div id=\"floatBoxBg\" style=\"height:"+$(document).height()+"px;filter:alpha(opacity=0);opacity:0;\"></div>";
  temp_float+="<iframe frameborder='0' style= 'position:absolute;visibility: inherit;top:0px;left:0px;width:100%;z-index:-1;'></iframe><div id=\"floatBox\" style='z-index:100' class=\"floatBox\">";
  temp_float+="<div class=\"title\"><h4></h4><span>关闭</span></div>";
  temp_float+="<div class=\"content\"></div>";
  temp_float+="</div>";
  $("body").append(temp_float);
  dialogFirst=false;
}
//DivSetVisible(true);
$("#floatBox .title span").click(function(){
  $("#floatBoxBg").animate({opacity:"0"},"normal",function(){$(this).hide();});
  $("#floatBox").animate({top:($(document).scrollTop()-(height=="auto"?300:parseInt(height)))+"px"},"normal",function(){$(this).hide();}); 
	if(isIe){
	setSelectState('');}
});

$("#floatBox .title h4").html(title);
contentType=content.substring(0,content.indexOf(":"));
content=content.substring(content.indexOf(":")+1,content.length);
switch(contentType){
  case "url":
  var content_array=content.split("?");
  $("#floatBox .content").ajaxStart(function(){
    $(this).html("loading...");
  });
  $.ajax({
    type:content_array[0],
    url:content_array[1],
    data:content_array[2],
	error:function(){
	  $("#floatBox .content").html("error...");
	},
    success:function(html){
      $("#floatBox .content").html(html);
    }
  });
  break;
  case "text":
  $("#floatBox .content").html(content);
  break;
  case "id":
  $("#floatBox .content").html($("#"+content+"").html());
  break;
  case "iframe":
  $("#floatBox .content").html("<iframe src=\""+content+"\" width=\"100%\" height=\""+(parseInt(height)-30)+"px"+"\" scrolling=\"auto\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>");
}

$("#floatBoxBg").show();
$("#floatBoxBg").animate({opacity:"0.5"},"normal");
$("#floatBox").attr("class","floatBox "+cssName);
$("#floatBox").css({display:"block",left:(($(document).width())/2-(parseInt(width)/2))+"px",top:($(document).scrollTop()-(height=="auto"?300:parseInt(height)))+"px",width:width,height:height});
$("#floatBox").animate({top:($(document).scrollTop()+50)+"px"},"normal"); 
}


var picUrl ="/images/face/";
var picStr=new StringBuffer();
function show_face(){
	picStr=new StringBuffer();
	if(picStr.toString()==""){
		var ii=1,size=0;
		var imgArr=new Array();
		for(var i=0;i<=19;i++) {
			var img=new Image();
			img.src=picUrl+"0/"+i+".jpg";
			imgArr[i]=img;
			size++;
		}
		picStr.append("<tr><td height='20px' colspan='10' style='cursor: pointer' style='background:#ffff00'>女生头像(20个)</td></tr>");
		for(var i=0;i<=19;i++) {
			picStr.append("<td height='20px' style='cursor: pointer'><img width='45' height='45' src='"+imgArr[i].src+"' onclick=\"face_in(0,'"+i+"')\"></td>");
			ii++;
			if(ii==11){
				picStr.append("</tr><tr style='background:#ffffff'>");
				ii=1;
			}
		}
		var imgArr2=new Array();
		for(var i=0;i<=19;i++) {
			var img=new Image();
			img.src=picUrl+"1/"+i+".jpg";
			imgArr2[i]=img;
			size++;
		}
		picStr.append("<tr><td height='20px' colspan='10' style='cursor: pointer' style='background:#ffff00'>男生头像(20个)</td></tr>");
		for(var i=0;i<=19;i++) {
			picStr.append("<td height='20px' style='cursor: pointer'><img width='45' height='45' src='"+imgArr2[i].src+"' onclick=\"face_in(1,'"+i+"')\"></td>");
			ii++;
			if(ii==11){
				picStr.append("</tr><tr style='background:#ffffff'>");
				ii=1;
			}
		}
		var imgArr3=new Array();
		for(var i=0;i<=8;i++) {
			var img=new Image();
			img.src=picUrl+"2/"+i+".jpg";
			imgArr3[i]=img;
			size++;
		}
		picStr.append("<tr><td height='20px' colspan='10' style='cursor: pointer' style='background:#ffff00'>其它头像(9个)</td></tr>");
		for(var i=0;i<=8;i++) {
			picStr.append("<td height='20px' style='cursor: pointer'><img width='45' height='45' src='"+imgArr3[i].src+"' onclick=\"face_in(2,'"+i+"')\"></td>");
			ii++;
			if(ii==11){
				picStr.append("</tr><tr style='background:#ffffff'>");
				ii=1;
			}
		}
	}
	$E("DivNone").style.display='';
	$E("DivNone").innerHTML="<table class='AllTab' style='background:#ffffff' cellSpacing=1 cellPadding=0><tr style='background:#ffffff'>"+picStr.toString()+"</tr></table>";
	
};
function MenuType() {
	$E("DivNone").innerHTML="";
	$E("DivNone").style.display="none";
};
function face_in(type,num){
	var typex = type;
	$E("face_div").value=picUrl+type+"/"+num+'.jpg';
	if(type==2){
		var sex_1=$E("sex_1_1").checked;
		var sex_0=$E("sex_0_0").checked;
		if(sex_1==true)typex=1;
		if(sex_0==true)typex=0;
	}
	$E("sex_"+typex).src=picUrl+type+"/"+num+".jpg";
    $E("sex_"+typex+"_"+typex).checked=true;
	MenuType();
};
